#ifndef MYSEARCH_H_INCLUDED
#define MYSEARCH_H_INCLUDED

#include <iostream>
#include <string>

using namespace std;

class SSTable
{
private:
    int length;
    int *origin;

public:
    SSTable();
    SSTable(int, int *);
    ~SSTable();
    int getLength();
    int *getOrigin();
    void setLength(int);
    void setOrigin(int *);
    int binSearch(int);
};

class BSTreeNode
{
private:
    int data;
    BSTreeNode *lchild;
    BSTreeNode *rchild;

public:
    BSTreeNode();
    BSTreeNode(int);
    BSTreeNode(int, BSTreeNode *, BSTreeNode *);
    ~BSTreeNode();
    int getData();
    BSTreeNode *getLChild();
    BSTreeNode *getRChild();
    void setData(int);
    void setLChild(BSTreeNode *);
    void setRChild(BSTreeNode *);
};

class BSTree
{
private:
    int num;
    BSTreeNode *root;

public:
    BSTree();
    BSTree(int, int *);
    ~BSTree();
    int getNum();
    BSTreeNode *getRoot();
    void setRoot(BSTreeNode *);
    void setNum(int);
    string printTree();
    bool searchNode(int);
    bool addNode(int);
    bool deleteNode(int);
    void print(BSTreeNode *, string &);
};

#endif // MYSEARCH_H_INCLUDED